package com.mtwp.dfs.domain.category;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/*
FileType 被单向关联到DiskStore
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Builder
@Entity
@Table(
        name = "dfs_file_type",
        uniqueConstraints = @UniqueConstraint(
                columnNames={"type"}
        )
)
public class FileType {
    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "updateTime")
    private Date updateTime;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "createTime")
    private Date createTime;

    /**
     * 编号
     */
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Id
    private Integer id;

    //顺序
    private Integer disOrder;

    private String name;

    /*
    folder(0),pic(1),video(2),txt(3),doc(4),link(5),music(6),other(10)
     */
    private Integer type;

    /*
     描述
    */
    private String description;

}
